<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>quick-cocos2d-x API Documents - framework.client.transition</title>
<link rel="stylesheet" href="luadocx-style.css" type="text/css" />
<link rel="stylesheet" href="luadocx-style-monokai.css" type="text/css" />
<script src="luadocx-highlight.min.js"></script>
<script type="text/javascript" charset="utf-8">hljs.initHighlightingOnLoad();</script>
</head>
<body>
  <div id="container">

    <table id="main">
      <tr>
        <td id="navigation">

          <h2>Links</h2>
          <ul>
            <li><a href="index.html">Index</a></li>
          </ul>

          <h2>Modules</h2>
          <ul>
            <li><a href="index.html">framework.init</a></li>
            <li><a href="framework.client.api.context.html">framework.client.api.Context</a></li>
            <li><a href="framework.client.api.eventprotocol.html">framework.client.api.EventProtocol</a></li>
            <li><a href="framework.client.api.gamenetwork.html">framework.client.api.GameNetwork</a></li>
            <li><a href="framework.client.api.gamestate.html">framework.client.api.GameState</a></li>
            <li><a href="framework.client.api.localize.html">framework.client.api.Localize</a></li>
            <li><a href="framework.client.api.store.html">framework.client.api.Store</a></li>
            <li><a href="framework.client.api.timer.html">framework.client.api.Timer</a></li>
            <li><a href="framework.client.api.gamenetwork.openfeint.html">framework.client.api.gamenetwork.OpenFeint</a></li>
            <li><a href="framework.client.audio.html">framework.client.audio</a></li>
            <li><a href="framework.client.crypto.html">framework.client.crypto</a></li>
            <li><a href="framework.client.device.html">framework.client.device</a></li>
            <li><a href="framework.client.display.html">framework.client.display</a></li>
            <li><a href="framework.client.init.html">framework.client.init</a></li>
            <li><a href="framework.client.luaj.html">framework.client.luaj</a></li>
            <li><a href="framework.client.luaoc.html">framework.client.luaoc</a></li>
            <li><a href="framework.client.network.html">framework.client.network</a></li>
            <li><a href="framework.client.scheduler.html">framework.client.scheduler</a></li>
            <li><strong>framework.client.transition</strong></li>
            <li><a href="framework.client.ui.html">framework.client.ui</a></li>
            <li><a href="framework.server.mysqleasy.html">framework.server.MysqlEasy</a></li>
            <li><a href="framework.server.rediseasy.html">framework.server.RedisEasy</a></li>
            <li><a href="framework.server.serveraction.html">framework.server.ServerAction</a></li>
            <li><a href="framework.server.serverapp.html">framework.server.ServerApp</a></li>
            <li><a href="framework.server.session.html">framework.server.Session</a></li>
            <li><a href="framework.server.init.html">framework.server.init</a></li>
            <li><a href="framework.shared.modelbase.html">framework.shared.ModelBase</a></li>
            <li><a href="framework.shared.debug.html">framework.shared.debug</a></li>
            <li><a href="framework.shared.errors.html">framework.shared.errors</a></li>
            <li><a href="framework.shared.functions.html">framework.shared.functions</a></li>
          </ul>

        </td> <!-- navigation -->

        <td id="content">

          <h1>Module <code>framework.client.transition</code></h1>

          <!-- BEGIN module doc -->

          <div id="module_doc">

<p>Actions, Transformations and Effects</p>

<br />


          </div>

          <!-- END module doc -->


          <!--  BEGIN functions index -->

          <h2>Functions</h2>
          <table class="function_list">


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_execute">transition.execute&nbsp;(target,&nbsp;action,&nbsp;args)</a></td>
              <td class="summary">Execute an action with a target.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_rotateTo">transition.rotateTo&nbsp;(target,&nbsp;args)</a></td>
              <td class="summary">Rotate a sprite to the rotation.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_moveTo">transition.moveTo&nbsp;(target,&nbsp;args)</a></td>
              <td class="summary">Moves a sprite to the position x,y. x and y are absolute coordinates by modifying it's position attribute.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_moveBy">transition.moveBy&nbsp;(target,&nbsp;args)</a></td>
              <td class="summary">Moves a sprite x,y points by modifying it's position attribute. x and y are relative to the position of the object.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_fadeIn">transition.fadeIn&nbsp;(target,&nbsp;args)</a></td>
              <td class="summary">Fades In an sprite. It modifies the opacity from 0 to 255. The &quot;reverse&quot; of this action is transition.fadeOut() .</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_fadeOut">transition.fadeOut&nbsp;(target,&nbsp;args)</a></td>
              <td class="summary">Fades Out an sprite. It modifies the opacity from 255 to 0. The &quot;reverse&quot; of this action is transition.fadeIn() .</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_fadeTo">transition.fadeTo&nbsp;(target,&nbsp;args)</a></td>
              <td class="summary">Fades an sprite. It modifies the opacity from the current value to a custom one.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_scaleTo">transition.scaleTo&nbsp;(target,&nbsp;args)</a></td>
              <td class="summary">Scales a sprite to a zoom factor by modifying it's scale attribute.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_sequence">transition.sequence&nbsp;(actions)</a></td>
              <td class="summary">Create an array of sequenceable actions given an table.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_removeAction">transition.removeAction&nbsp;(action)</a></td>
              <td class="summary">Stop the action.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_stopTarget">transition.stopTarget&nbsp;(target)</a></td>
              <td class="summary">Stop all actions for the target.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_pauseTarget">transition.pauseTarget&nbsp;(target)</a></td>
              <td class="summary">Pauses the target, all running actions and newly added actions will be paused.</td>
            </tr>


            <tr>
              <td class="name" nowrap><a href="#anchor_transition_resumeTarget">transition.resumeTarget&nbsp;(target)</a></td>
              <td class="summary">Resumes the target.</td>
            </tr>


          </table>

          <!--  END functions index -->

          <br />
          <br />

          <!-- BEGIN functions details -->

          <h2>Functions</h2>
          <dl class="function">


            <dt class="">
              <a name="anchor_transition_execute"></a>
              <h3>transition.execute (target, action, args)</h3>
            </dt>

            <dd class="">

<p>Execute an action with a target.</p>

<h3>Example:</h3>


<pre><code class="lua">-- moving right target 100 points, durations of 2.0 seconds.
local action = CCMoveBy:create(ccp(100, 0), 0.2)

local args = {
    delay = 3.0,                        -- before moving, delay 3.0 seconds
    easing = "CCEaseBackInOut",         -- use CCEaseBackInOut for easing
    onComplete = function()             -- call function after moving completed
        echo("MOVING COMPLETED")
    end,
}
transition.execute(sprite, action, args)
</code></pre>

<p>Note: <strong>Other transiton methods can also use the same args parameters.</strong></p>

<h3>Parameters:</h3>

<ul>
<li><p>CCNode <strong>target</strong></p></li>
<li><p>CCAction <strong>action</strong></p></li>
<li><p>[<em>optional table <strong>args</strong></em>]</p></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_rotateTo"></a>
              <h3>transition.rotateTo (target, args)</h3>
            </dt>

            <dd class="">

<p>Rotate a sprite to the rotation.</p>

<h3>Example:</h3>


<pre><code class="lua">-- rotate sprite to 200
transition.rotateTo(sprite, {time = 2.0, rotate = 200})
</code></pre>

<h3>Parameters:</h3>

<ul>
<li><p>CCNode <strong>target</strong></p></li>
<li><p>table <strong>args</strong></p></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_moveTo"></a>
              <h3>transition.moveTo (target, args)</h3>
            </dt>

            <dd class="">

<p>Moves a sprite to the position x,y. x and y are absolute coordinates by modifying it's position attribute.</p>

<h3>Example:</h3>


<pre><code class="lua">-- Moving sprite to 100, 100
transition.moveTo(sprite, {time = 2.0, x = 100, y = 100})
</code></pre>

<h3>Parameters:</h3>

<ul>
<li><p>CCNode <strong>target</strong></p></li>
<li><p>table <strong>args</strong></p></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_moveBy"></a>
              <h3>transition.moveBy (target, args)</h3>
            </dt>

            <dd class="">

<p>Moves a sprite x,y points by modifying it's position attribute. x and y are relative to the position of the object.</p>

<h3>Example:</h3>


<pre><code class="lua">-- Moving right and up
transition.moveBy(sprite, {time = 2.0, x = 100, y = 100})
</code></pre>

<h3>Parameters:</h3>

<ul>
<li><p>CCNode <strong>target</strong></p></li>
<li><p>table <strong>args</strong></p></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_fadeIn"></a>
              <h3>transition.fadeIn (target, args)</h3>
            </dt>

            <dd class="">

<p>Fades In an sprite. It modifies the opacity from 0 to 255. The "reverse" of this action is transition.fadeOut() .</p>

<h3>Example:</h3>


<pre><code class="lua">transition.fadeIn(sprite, {time = 1.0})
</code></pre>

<h3>Parameters:</h3>

<ul>
<li><p>CCNode <strong>target</strong></p></li>
<li><p>table <strong>args</strong></p></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_fadeOut"></a>
              <h3>transition.fadeOut (target, args)</h3>
            </dt>

            <dd class="">

<p>Fades Out an sprite. It modifies the opacity from 255 to 0. The "reverse" of this action is transition.fadeIn() .</p>

<h3>Parameters:</h3>

<ul>
<li><p>CCNode <strong>target</strong></p></li>
<li><p>table <strong>args</strong></p></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_fadeTo"></a>
              <h3>transition.fadeTo (target, args)</h3>
            </dt>

            <dd class="">

<p>Fades an sprite. It modifies the opacity from the current value to a custom one.</p>

<h3>Example:</h3>


<pre><code class="lua">transition.fadeTo(sprite, {time = 2.0, opacity = 200})
</code></pre>

<h3>Parameters:</h3>

<ul>
<li><p>CCNode <strong>target</strong></p></li>
<li><p>table <strong>args</strong></p></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_scaleTo"></a>
              <h3>transition.scaleTo (target, args)</h3>
            </dt>

            <dd class="">

<p>Scales a sprite to a zoom factor by modifying it's scale attribute.</p>

<h3>Example:</h3>


<pre><code class="lua">transition.scaleTo(sprite1, {time = 2.0, scale = 2.0})      -- zoom sprite
transition.scaleTo(sprite2, {time = 2.0, scaleX = 2.0})     -- zoom horizontal
transition.scaleTo(sprite3, {time = 2.0, scaleY = 2.0})     -- zoom vertical
</code></pre>

<h3>Parameters:</h3>

<ul>
<li><p>CCNode <strong>target</strong></p></li>
<li><p>table <strong>args</strong></p></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_sequence"></a>
              <h3>transition.sequence (actions)</h3>
            </dt>

            <dd class="">

<p>Create an array of sequenceable actions given an table.</p>

<h3>Example:</h3>


<pre><code class="lua">local function onComplete()
    echo("SEQUENCE COMPLETED")
end

local action = transition.sequence({
    CCMoveBy:create(sprite, ccp(100, 0)),   -- moving right
    CCDelayTime:create(1.0),                -- delay 1 seconds
    CCMoveBy:create(sprite, ccp(0, 100)),   -- moving up
    CCCallFunc:create(onComplete),          -- call function
})

sprite:runAction(action)
</code></pre>

<h3>Parameters:</h3>

<ul>
<li>table <strong>actions</strong></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_removeAction"></a>
              <h3>transition.removeAction (action)</h3>
            </dt>

            <dd class="">

<p>Stop the action.</p>

<h3>Example:</h3>


<pre><code class="lua">local action = transition.moveTo(sprite, {time = 2.0, x = 100, y = 100})
....
transition.removeAction(action) -- stop moving
</code></pre>

<h3>Parameters:</h3>

<ul>
<li>CCAction <strong>action</strong></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_stopTarget"></a>
              <h3>transition.stopTarget (target)</h3>
            </dt>

            <dd class="">

<p>Stop all actions for the target.</p>

<h3>Example:</h3>


<pre><code class="lua">transition.moveTo(sprite, {time = 2.0, x = 100, y = 100})
transition.fadeOut(sprite, {time = 2.0})
....
transition.stopTarget(sprite) -- stop moving, stop fades
</code></pre>

<h3>Parameters:</h3>

<ul>
<li>CCNode <strong>target</strong></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_pauseTarget"></a>
              <h3>transition.pauseTarget (target)</h3>
            </dt>

            <dd class="">

<p>Pauses the target, all running actions and newly added actions will be paused.</p>

<h3>Parameters:</h3>

<ul>
<li>CCNode <strong>target</strong></li>
</ul>

            </dd>


            <dt class="">
              <a name="anchor_transition_resumeTarget"></a>
              <h3>transition.resumeTarget (target)</h3>
            </dt>

            <dd class="">

<p>Resumes the target.</p>

<h3>Parameters:</h3>

<ul>
<li>CCNode <strong>target</strong></li>
</ul>

            </dd>


          </dl>

          <!-- BEGIN functions details -->


      </td> <!-- id="content" -->

      </tr>
    </table> <!-- id="main" -->

    <div id="about">
      <i>update: 2013-05-08 09:30:25, generated by <a href="http://github.com/dualface/luadocx">luadocx 1.1</a></i>
    </div> <!-- id="about" -->

  </div> <!-- id="container" -->

</body>
</html>
